using Thinktecture.Tools.Web.Services.CodeGeneration.Utilities;

namespace Thinktecture.Tools.Web.Services.CodeGeneration.Driver
{
	public enum ConfigurationFileType
	{
		none,
		web,
		app,
	}

	public class ContractFirstArguments
	{
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName="l", LongName="language", HelpText = ".NET code language to emit.")]
		public string CodeLanguage;
		// CSC 11/25/2004
		// defaulted to current directory and changed help
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName="cf", LongName="configurationfile", HelpText = "Location of the configuration file to edit for /ec or /ma. Default is the current directory.")]
		public string ConfigurationFile = ".";
		// CSC 11/25/2004
		// Added switch to select web.config or app.config
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName="ct", LongName="configurationtype", HelpText = "Type of the configuration file to edit for /ec or /ma. Choose web to edit web.config or app for app.config when specifing /ec or /ma.")]
		public ConfigurationFileType ConfigurationType = ConfigurationFileType.none;
	
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName="ec", LongName="endpointconfiguration", HelpText = "Enable endpoint Url configuration.")]
		public bool EnableEndpointConfiguration;
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName ="ma", LongName ="messageaccess",  HelpText = "Enable SOAP message access for client-side proxies.")]
		public bool EnableSoapMessagesAccess;
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName ="v", LongName ="validation", HelpText = "Enable SOAP message validation for Web Services.")]
		public bool EnableValidation;
		// CSC 11/19/2004
		// Generate proxies my default.
		// CSC 11/25/2005
		// Removed GenerateClientSideCode

		// CSC 11/24/2004
		// Seperate switch for server stubs
		// CSC 11/25/2005
		// Changed help text
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName ="s", LongName ="server", HelpText = "Generate service stub and implementation instead of proxy. The default is off.")]
		public bool GenerateServerCode;
		// CSC 11/24/2004
		// nologo switch to be consistent with wsdl.exe
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName ="no", LongName ="nologo", HelpText = "Suppress the banner.")]
		public bool SkipBanner;
		// CSC 11/19/2004
		// New parameter for proxy file name
		// CSC 11/24/2004
		// changed switch name to be consistent with wsdl.exe
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName ="o", LongName ="out", HelpText = "Filename for the proxy to generate.")]        
		public string ProxyFileName;
		// CSC 11/19/2004
		// New parameter for service stub file name
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName ="sf", LongName ="stubfilename", HelpText = "Filename for the service stub to generate.")]        
		public string ServiceStubFileName;
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName ="i", LongName ="implementation", HelpText = "Filename for the Web Service implementation file.")]
		public string WebServiceImplementationFile;
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName ="c", LongName ="collections", HelpText = "Generate collections instead of arrays.")]
		public bool GenerateCollections;
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName ="pr", LongName ="properties", HelpText = "Generate properties instead of fields.")]
		public bool GenerateProperties;
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName ="ser", LongName ="serializable", HelpText = "Generate [Serializable] types.")]
		public bool GenerateSerializableTypes;
		// CSC 11/16/2004
		// Made namespace a required parameter
		// CSC 11/19/2004
		// Reverted to original, namespace is not required
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName = "n", LongName = "namespace", HelpText = "Namespace for the .NET code.")]
		public string Namespace;
		[DefaultCommandLineArgument(CommandLineArgumentType.AtMostOnce, HelpText = "WSDL interface contract and XML schema to process.")]
		public string WsdlLocation;
		// CSC 02/05/2005
		// added argument for the new assembly parameter
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName = "an", LongName = "assemblyname", HelpText = "The name of the web service assembly.")]
		public string AssemblyName;
		// CSC 02/22/2005
		// added parameter for the new multiple file parameter
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName = "mf", LongName = "multiplefiles", HelpText = "Follow wsdl and schema references and generate multiple files.")]
		public bool GenerateMultipleFiles;
		// CSC 02/22/2005
		// added parameter for the new multiple file parameter
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName = "if", LongName = "interface", HelpText = "Generate interface for the service.")]
		public bool GenerateInterface = true;
		// CSC 02/22/2005
		// added parameter for the new multiple file parameter
        // BDS Defaulted this to false for client side code generation.
		[CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName = "h", LongName = "genhelp", HelpText = "Generate help.")]
		public bool GenerateHelp;

        // BDS 12/21/2005
        // Added parameter for the new enable Wsdl parameter.
        [CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName = "ew", LongName = "enablewsdl", HelpText = "Expose the WSDL at the ASMX endpoint.")]
        public bool EnableWsdl = false;

        // BDS 12/21/2005
        // Added parameter for the new enable data binding parameter.
        [CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName = "db", LongName = "databinding", HelpText = "Generate code for data binding.")]
        public bool DataBinding = false;

        // BDS 12/21/2005
        // Added parameter for No use generic list.
        [CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName = "gl", LongName = "genericlist", HelpText = "Convert arrays to generic lists.")]
        public bool GenericList = false;

        // BDS 12/21/2005
        // Added parameter for the new order identifiers parameter.
        [CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName = "oi", LongName = "ordered", HelpText = "Emit XmlSerializer order identifiers.")]
        public bool Ordered = false;

        // BDS 12/21/2005
        // Added parameter for the old async code parameter.
        [CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName = "oac", LongName = "oldasync", HelpText = "Generate old asynchronous code for proxy.")]
        public bool OldAsync = false;

        // BDS 12/21/2005
        // Added parameter for Adjust casing parameter.
        [CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName = "ac", LongName = "adjustcasing", HelpText = "Use XSD and .NET Framework naming conventions.")]
        public bool AdjustCasing = false; 

        // BDS 12/21/2005
        // Added parameter for No Xxx Specified Handling parameter.
        [CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName = "nxs", LongName = "nospecifiedhandling", HelpText = "Prevent generating code for XxxSpecified handling.")]
        public bool NoSpecifiedHandling = false;

        // BDS 01/03/2005
        // Added parameter for overwriting files.
        [CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName = "ow", LongName = "overwrite", HelpText = "Overwrite the existing files.")]
        public bool Overwrite = false;

        // BDS 29/09/2006
        // Added parameter for data contract namespace.
        [CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName = "dcn", LongName = "dcnamespace", HelpText = "Data contract namespace.")]
        public string DataContractNamespace;

        // BDS 29/09/2006
        // Added parameter for data contract output filename.
        [CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName = "dco", LongName = "dcoutput", HelpText = "Data contract output file name.")]
        public string DataContractOutput;

        // BDS 29/09/2006
        // Added parameter for data contract code generation.
        [CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName = "dc", LongName = "datacontracts", HelpText = "Generate data contract code.")]
        public bool DataContract = false;

        // CMCK 30/01/2009
        // Added parameter to control removing the System.ComponentModel.DefaultValueAttribute to be compatible with NET.CF
        [CommandLineArgument(CommandLineArgumentType.AtMostOnce, ShortName = "rda", LongName = "rmdefaultattribute", HelpText = "Remove any System.ComponentModel.DefaultValueAttributes")]
	    public bool RemoveDefaultValueAttribute = false;

        // Default constructor.
        public ContractFirstArguments()
        {
            GenerateHelp = GenerateServerCode ? true : false;
        }
	}
}